Crate tauri

source
Expand description

Tauri is a framework for building tiny, blazing fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with.

§Cargo features

The following are a list of Cargo features that can be enabled or disabled:

  • wry (enabled by default): Enables the wry runtime. Only disable it if you want a custom runtime.
  • tracing: Enables tracing for window startup, plugins, Window::eval, events, IPC, updater and custom protocol request handlers.
  • test: Enables the [test] module exposing unit test helpers.
  • dox: Internal feature to generate Rust documentation without linking on Linux.
  • objc-exception: Wrap each msg_send! in a @try/@catch and panics if an exception is caught, preventing Objective-C from unwinding into Rust.
  • linux-protocol-headers: Enables headers support for custom protocol requests on Linux. Requires webkit2gtk v2.36 or above.
  • isolation: Enables the isolation pattern. Enabled by default if the tauri > pattern > use config option is set to isolation on the tauri.conf.json file.
  • custom-protocol: Feature managed by the Tauri CLI. When enabled, Tauri assumes a production environment instead of a development one.
  • updater: Enables the application auto updater. Enabled by default if the updater config is defined on the tauri.conf.json file.
  • devtools: Enables the developer tools (Web inspector) and Window::open_devtools. Enabled by default on debug builds. On macOS it uses private APIs, so you can’t enable it if your app will be published to the App Store.
  • shell-open-api: Enables the api::shell module.
  • http-api: Enables the api::http module.
  • http-multipart: Adds support to multipart/form-data requests.
  • reqwest-client: Alias for the http-api feature flag.
  • native-tls-vendored: Compile and statically link to a vendored copy of OpenSSL.
  • reqwest-native-tls-vendored: Alias for the native-tls-vendored feature flag.
  • os-api: Enables the api::os module.
  • process-command-api: Enables the api::process::Command APIs.
  • global-shortcut: Enables the global shortcut APIs.
  • clipboard: Enables the clipboard APIs.
  • process-relaunch-dangerous-allow-symlink-macos: Allows the api::process::current_binary function to allow symlinks on macOS (this is dangerous, see the Security section in the documentation website).
  • dialog: Enables the api::dialog module.
  • notification: Enables the api::notification module.
  • fs-extract-api: Enabled the tauri::api::file::Extract API.
  • cli: Enables usage of clap for CLI argument parsing. Enabled by default if the cli config is defined on the tauri.conf.json file.
  • system-tray: Enables application system tray API. Enabled by default if the systemTray config is defined on the tauri.conf.json file.
  • macos-private-api: Enables features only available in macOS’s private APIs, currently the transparent window functionality and the fullScreenEnabled preference setting to true. Enabled by default if the tauri > macosPrivateApi config flag is set to true on the tauri.conf.json file.
  • windows7-compat: Enables compatibility with Windows 7 for the notification API.
  • window-data-url: Enables usage of data URLs on the webview.
  • compression *(enabled by default): Enables asset compression. You should only disable this if you want faster compile times in release builds - it produces larger binaries.
  • config-json5: Adds support to JSON5 format for tauri.conf.json.
  • config-toml: Adds support to TOML format for the configuration Tauri.toml.
  • icon-ico: Adds support to set .ico window icons. Enables Icon::File and Icon::Raw variants.
  • icon-png: Adds support to set .png window icons. Enables Icon::File and Icon::Raw variants.

§Cargo allowlist features

The following are a list of Cargo features that enables commands for Tauri’s API package. These features are automatically enabled by the Tauri CLI based on the allowlist configuration under tauri.conf.json.

  • api-all: Enables all API endpoints.

§Clipboard allowlist

§Dialog allowlist

§Filesystem allowlist

§Global shortcut allowlist

§HTTP allowlist

§Notification allowlist

§OS allowlist

§Path allowlist

§Process allowlist

§Protocol allowlist

  • protocol-all: Enables all Protocol APIs.
  • protocol-asset: Enables the asset custom protocol.

§Shell allowlist

§Window allowlist

§App allowlist

Re-exports§

Modules§

  • The Tauri API interface.
  • The singleton async runtime used by Tauri and exposed to users.
  • The Tauri custom commands types and traits.
  • The Tauri plugin extension to expand Tauri functionality.
  • The allowlist scopes.
  • testtest
    Utilities for unit testing on Tauri applications.
  • updaterupdater
    The Tauri updater.
  • The Tauri window types and functions.

Macros§

Structs§

Enums§

Constants§

Traits§

Functions§

Type Aliases§

  • A closure that is run every time Tauri receives a message it doesn’t explicitly handle.
  • A closure that is responsible for respond a JS message.
  • A closure that is run once every time a window is created and loaded.
  • Result<T, ::tauri::Error>
  • A closure that is run when the Tauri application is setting up.
  • A task to run on the main thread.
  • Wrywry
    A Tauri Runtime wrapper around wry.

Attribute Macros§

  • Mark a function as a command handler. It creates a wrapper function with the necessary glue code.